package com.example.demo.service;

import com.example.demo.mapper.NewsInfoMapper;
import com.example.demo.model.NewsInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewsInfoService {
    @Autowired
    private NewsInfoMapper newsInfoMapper;
    public NewsInfo queryNewsInfoById(Integer id) {
        return newsInfoMapper.queryNewsInfoById(id);
    }

    public List<NewsInfo> getNewsList() {
        return (List<NewsInfo>) newsInfoMapper.getNewsList();
    }

    public void addNews(NewsInfo newsInfo) {
        newsInfoMapper.addNews(newsInfo);
    }

    public void updateNews(NewsInfo newsInfo) {
        newsInfoMapper.updateNews(newsInfo);
    }

    public Integer batchDelete(List<Integer> ids) {
        return newsInfoMapper.batchDelete(ids);
    }

    public NewsInfo getNewsText(Integer id) {
        return newsInfoMapper.getNewsText(id);
    }
}
